Dimensioning QObjects.

QObjects need to be DIMmed as well as variables. The RQDOCS cover then nicely.
This session deals with the ones we use for this program. There are a few new 
ones, but their functionality will be covered here. Some are visible and some 
are aren't displayed. Once dimensioned, the visible objects can be seen with 
the SHOW directive, usually a QOjbect.SHOWmodal command.

 
 Refer to your RQDOCS folder along with this tutorial. You made a shortcut to the 
 contents file earlier, so it will be easy for you to research it.

 QFileStream is dimensioned to receive the data from an Icon file. There  are many 
 things it can be used for. Our program uses one of its parameters to tell us the 
 number of data bytes the file contains and store that value in a  previously 
 dimensioned variable named EOZ. The Array of bytes to hold the data  has already 
 been dimensioned as array z( ) to hold the File's bytes as z(0 to EOZ).

 QQpenDialog prompts to select and open the File and retreive its data bytes.
 QSaveDialog prompts to save the contents of Z(0 to EOZ) back to the disk.

 QFont defines the fonts type, color and size. 
 QForm is old news. It holds the visible objects to be SHOWed.
 QCanvas is dimensioned twice. One Canvas for the icon sized as it will be displayed 
     in Windows and one image zoomed 8 times for ease of editing. Several mouse 
     events are sub-routined to handle the editing functions for the magnified one.

 QScrollBox is named Display to avoid misinterpretation because the Q name is too similar 
     to the name of the QScrollbars used later. The ScrollBox is CHILD to the FORM but 
     is PARENT to two QRichEdit objects. This permits scrolling both QRichedit fields 
     using only the QScrollbox vertical slide-bar.

 QRichEdit objects are eOFFset and eHEX. The offset displaye the relative address of the 
     bytes in the Icon file. eHEX displays the bytes in ascii hex format. eOFFset is 
     write protected after displaying the addresses; however, the text in the eHEX area 
     can be edited with the keyboard.

 QButtons are provided for operator intervention such as OPEN, SAVE, NEW, RESTORE, BACKUP 
     and MODE. Their functions will be covered later, this session. An aditional TEMP 
     QButton and Temp QEdit is also created to facilitate developmental interaction within 
     the program during RUN time.

 QPanel objects are used to display the 16 color palettes. Each QPanel's hint property 
     also contains its unique hex number for identification purposes later using the 
     SENDER variable. All sixteen are dimensioned using a FOR-NEXT loop saving a lot of 
     typing in the source file. They will be colored to show the color they they represent 
     from the Icon's Data File. They are named Palette(0 to 15).

     A Qpanel named Activecolor is also used to display a color selected from one of the 
     16 palettes that will be used to create the icon image.

     Another Qpanel named SelectColor is used to display a new color to be selected for 
     creating the icon, using the three QScrollBars for the RGB color.

 QScrollbar objects are created with a FOR-NEXT loop for Scroll(0-2). These three 
     Scrollbars are used to define the RED, GREEN and BLUE components of a color.

 QTIMER is named IRIG rather than TIME or TIMER because they are reserved words for the
     BASIC instructions. Keep reserved words in mind when Koining QObject names.
     It's only purpose is to branch to the INIT sub after a defined interval. This event 
     starts the running program without operator intervention with a QButton. A half 
     second (500 milisecs) after the QTimer is dimensioned the program vectors to the 
     INIT sub- routine.

Finally SHOWMODAL is called. After the program has performed it's loading and display 
functions, the program returns to this position awaiting an event initiated with one 
of the QButtons or ONevent instruction declared in the other QOBJECTs such as posting,
SAVING, etc. 

 
This basically speaks about the visible objects that can be seen on the WINDOW's QForm 
if the program icon has been double clicked. The QHEX panel will display a prompt for the 
operator to click on the OPEN QButton in order to select an ICO file from the hard drive. 
But that message is part of one of the sub-routines that is initiated with the QTIMER on 
"program RUN" and will be covered in detail later. All the objects will have the typical 
WINDOW's haze grap color, and waiting for the operator to do something intelligent. 

 

Softalk

This pretty well covers the QObjects and how they are displayed on the QForm.
It might serve to look these QObject's properties over rather carefully before 
continuing on with subsequent sessions. Question will come to mind why certain
properties have been selected. Many of these questions will be answered in 
subsequent sessions and many can be understood by referencing the RQDOC write-ups.
Don't bother to memorize the assignments. After looking them over carefully, you
will not remember them all. However, you will not forget what you read either. 
It will be recalled (as a hunch perhaps) when you see these features future sessions.

HAPPY HACKING